var base = require('./base');
/**
 * 
 */
var Comment_Schema = new base.Schema({
    nickname: {
        type:String
    },
    openid: {
        type:String
    },
    avatarUrl: {
        type:String
    },
    to_id: {    // 评论谁
        type:String
    },
    parent_objectID: { // 父级object_id
        type:String
    },
    content: {
        type:String
    },
    imgUrl:{　// 评论图片，待考虑
        type:String,
        default: null
    },
    createTime: {
        type: Date,
        default: Date.now
    },
    updateTime: {
        type: Date,
        default: Date.now
    }
}, {
        versionKey: false,
        timestamps: { createdAt: 'createTime', updatedAt: 'updateTime' }
});

Comment_Schema.index({parent_objectID:1})

var Comment = base.mongoose.model('Comment', Comment_Schema);

module.exports = Comment;
